<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>时间会证明.我爱你</title>
    <link rel="stylesheet" href="<?php $this->options->themeUrl('static/layui/css/layui.css'); ?>">
    <style type="text/css">
        .nred{
            color: red;
        }
    </style>
</head>
<body>
<div  style="margin-top: 70px;margin-right: 50px;">
    <div class="layui-form">
        <div class="layui-form-item">
            <div class="layui-input-block">
                <div class="layui-form-mid layui-word-aux" style="color: #fa7c8d!important;font-size: 20px;">表白小工具</div>
                <div class="layui-form-mid layui-word-aux">效果示例（密码：1）：<a href="http://问兰忆柳.时间会证明.我爱你" target="_blank">问兰忆柳.时间会证明.我爱你</a></div>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label nred">邀 请 码</label>
            <div class="layui-input-block">
                <input type="text" id="inviteCode" placeholder="必填" autocomplete="off" class="layui-input" value="520">
                <div class="layui-form-mid layui-word-aux">默认520</div>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label nred">域名名称</label>
            <div class="layui-input-block">
                <input type="text" id="domainName" placeholder="必填" autocomplete="off" class="layui-input">
                <div class="layui-form-mid layui-word-aux">【此值为全站唯一值，并且只能填写数字、小写字母、中文；不能出现其他特殊字符或表情！】</div>
                <div class="layui-form-mid layui-word-aux">如果此字段填写的是“晨”字，最后生成的域名是：晨.时间会证明.我爱你</div>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">网页标题</label>
            <div class="layui-input-block">
                <input type="text" id="siteTitle" placeholder="选填" autocomplete="off" class="layui-input">
                <div class="layui-form-mid layui-word-aux">浏览器最上面显示的标题；例如：我想对你说</div>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label nred">对方姓名</label>
            <div class="layui-input-block">
                <input type="text" id="object" placeholder="必填" autocomplete="off" class="layui-input">
                <div class="layui-form-mid layui-word-aux">你想给谁说的话</div>
            </div>
        </div>

        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">想说的话</label>
            <div class="layui-input-block">
                <textarea id="whisper" placeholder="选填" class="layui-textarea" style="height: 200px;resize: unset;"></textarea>
                <div class="layui-form-mid layui-word-aux">例如：我稀罕你</div>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">私密暗号</label>
            <div class="layui-input-block">
                <input type="text" id="pass" placeholder="选填" autocomplete="off" class="layui-input">
                <div class="layui-form-mid layui-word-aux">打开网页需要输入密码，不填就不需要。</div>
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" id="submitData">立即提交</button>
            </div>
        </div>
    </div>
</div>
<script src="<?php $this->options->themeUrl('static/layui/layui.js'); ?>"></script>
<script src="<?php $this->options->themeUrl('static/js/jquery-3.3.1.min.js'); ?>"></script>
<script src="<?php $this->options->themeUrl('static/js/md5.js'); ?>"></script>
<script src="<?php $this->options->themeUrl('static/js/verificationCode.js?t=20220603'); ?>"></script>
<script type="text/javascript">
    var layer;
    layui.use('layer', function(){
        layer = layui.layer;
    });
    $(document).on('click','#submitData',function () {
        let inviteCode = $("#inviteCode").val();
        let domainName = $("#domainName").val();
        let object = $("#object").val();
        if(!inviteCode || !domainName || !object){
            layer.msg('必填项不能为空');
            return '';
        }
        let siteTitle = $("#siteTitle").val();
        let whisper = $("#whisper").val();
        let pass = $("#pass").val();
        // var loading = layer.load(1, {shade: [0.1,'#fff']});
        getVerifySign();
        $.post("/?wumingyouxia101_love=addWhisper",
            {"inviteCode":inviteCode, "domainName":domainName, "object":object, "siteTitle":siteTitle, "whisper":whisper, "pass":pass,
                "timeStamp":timeStamp,"verifySign":verifySign}
            ,function (res) {
                // layer.close(loading);
                if(res.code == 0){
                    layer.confirm(res.message, {
                        btn: ['前往']
                    }, function(index, layero){
                        // window.location.href=res.data['url'];
                        window.open(res.data['url']);
                    });
                }else{
                    layer.alert(res.message);
                }
            })
    });
</script>
</body>
</html>